<template>


		<section class="form">
      <HistroySearch 
        :type='type' 
        :historyRefresh='historyRefresh'
        @getHistoryData='(data)=>{this.form = data}'
      />  
			<el-form :model="form" ref='staffInfoTable' label-position="right" label-width="150px">

				<el-collapse v-model.trim="activeNames">

          <el-collapse-item title="查询条件" name='0'>

            <el-col :span='8'>

              <el-form-item label='选择年月' label-width='90px'>
								<el-date-picker 
                  size='small' 
                  style='width:40%;float:left'
                  v-model.trim="form.beginSearchDt"
                  @change='(value) => form.beginSearchDt = value'
                  :editable = 'false'
                  type='month'
                  format='yyyy-MM' />

                  <span style='float:left'>&nbsp;-&nbsp;</span>

                <el-date-picker 
                  size='small' 
                  style='width:40%;float:left'
                  v-model.trim="form.searchDt"
                  @change='(value) => form.searchDt = value'
                  :editable = 'false'
                  type='month'
                  format='yyyy-MM' />
							</el-form-item>

            </el-col>


            <el-col :span='12'>
              
                <el-form-item label='管控权' label-width='60px'>
              
                  <el-checkbox-group v-model='form.controlPower'>

                    <span style="display:inline-block;width:120px" v-for='(k,i) in controlPowerList' :key='i'>
                      <el-checkbox  
                        :label='k.value'
                      >
                       {{k.label}}
                     </el-checkbox> 
                    </span>

                  </el-checkbox-group>
                </el-form-item>

            
            </el-col>

            <el-col :span='4'>
               <el-form-item label='是否并表权' label-width='90px'>
                 <el-checkbox v-model='form.unionPower'></el-checkbox> 
               </el-form-item>
               
            </el-col>

           

          </el-collapse-item>


					<el-collapse-item title="部门信息" name="1">

						<el-col :span='12'>

              <el-form-item label='一级组织'>
								<el-col :span='18'>
									<el-select @clear='handleClear("oneOrg")'  @visible-change='(val)=>{selectVisibleChange(val,"oneOrg")}' readonly @change='(val)=>{handleOneTwoChange(val,"oneOrg")}' clearable size='small' style='width:100%' v-model.trim='form.oneOrg'>
										<el-option v-for='(k,i) in oneOrgList' :key='k.id' :value='k.descr'></el-option>
									</el-select>
								</el-col>
							</el-form-item>


					  	<el-form-item label='三级组织'>
								<el-col
                   :span='18'
                   @mouseleave.native.stop='close.threeOrg = false'
                   @mouseenter.native.stop='showCloseIcon("threeOrg")'
                    style="position:relative">
									<el-input :title='form.threeOrg' size='small' readonly @focus.stop='handleSearchDialog("threeOrg")' :on-icon-click='()=>{handleSearchDialog("threeOrg")}' icon='search' v-model.trim='form.threeOrg'></el-input>
                   <i @click.stop='closeIconClick("threeOrg")' v-show='close.threeOrg' class='close-x el-icon-circle-cross'></i>
								</el-col>
							</el-form-item> 

              <el-form-item label='部门'>
								<el-col 
                  :span='18'
                  style="position:relative"
                  @mouseleave.native.stop='close.descr = false'
                  @mouseenter.native.stop='showCloseIcon("descr")'
                >
									<el-input size='small'  @focus.stop='handleSearchDialog("descr")' :on-icon-click='()=>{handleSearchDialog("descr")}' icon='search' v-model.trim='form.descr'></el-input>
                   <i @click.stop='closeIconClick("descr")' v-show='close.descr' class='close-x el-icon-circle-cross'></i>
								</el-col>

                <el-col style="margin-left:10px" :span='5'>
									<el-checkbox v-model='form.whetherSubDepartment'>是否包含子部门</el-checkbox>
								</el-col>
                
							</el-form-item> 
  
						</el-col>

						<el-col :span='12' class="check-box">
							<el-form-item label='二级组织'>
								<el-col :span='18'>
									<el-select @clear='handleClear("twoOrg")' @visible-change='(val)=>{selectVisibleChange(val,"twoOrg")}'	 @change='(val)=>{handleOneTwoChange(val,"twoOrg")}' clearable size='small' style='width:100%' v-model.trim='form.twoOrg'>
										<el-option v-for='(k,i) in twoOrgList':key='k.id' :value='k.descr'></el-option>
									</el-select>
								</el-col>
							</el-form-item>

							<el-form-item label='四级组织'>
								<el-col 
                  :span='18'
                  @mouseleave.native.stop='close.fourOrg = false'
                  @mouseenter.native.stop='showCloseIcon("fourOrg")'
                  style="position:relative"
                >
									<el-input :title='form.fourOrg'  @focus.stop='handleSearchDialog("fourOrg")' :on-icon-click='()=>{handleSearchDialog("fourOrg")}' icon='search' size='small' v-model.trim='form.fourOrg'></el-input>
                  <i @click.stop='closeIconClick("fourOrg")' v-show='close.fourOrg' class='close-x el-icon-circle-cross'></i>

								</el-col>
							</el-form-item>

						</el-col>

					</el-collapse-item>


          <el-collapse-item title="个人信息" name="2">

						<el-col :span='12'>

              <el-form-item label='姓名'>
								<el-col :span='18'>
                  <el-input size='small' v-model.trim='form.searchName'></el-input>
								</el-col>
							</el-form-item>

              <el-form-item label='民族'>
								<el-col :span='18'>
                  <el-select clearable size='small' style='width:100%' v-model.trim='form.ethnic'>
										<el-option v-for='(k,i) in ethnicList' :value='k.ethnic'></el-option>
									</el-select>
								</el-col>
							</el-form-item>
             

							<el-form-item label='专业技术职称'>
								<el-col :span='18'>
									<el-input size='small' v-model.trim='form.zyjszc'></el-input>
								</el-col>
							</el-form-item>

              <el-form-item label='婚姻状况'>
                <el-checkbox-group v-model.trim='form.marStatus'>
                  <el-checkbox 
                    v-for='(k,i) in marStatusList' 
                    :label='k.mar_status'
                    :key='i'
                  >
                    {{k.mar_desc}}
                  </el-checkbox> 
                </el-checkbox-group>
							</el-form-item>

             

              <el-form-item label='参加工作时间'>
                <div>
                  <el-col :span='18'>
                    <el-date-picker 
                      size='small' 
                      style='width:46%;float:left'
                      v-model.trim="form.beginStartDtChn"
                      @change='(value) => form.beginStartDtChn = value'
                      :editable = 'false'
                      format='yyyy-MM-dd'>
                    </el-date-picker>
                      &nbsp;&nbsp;-
                    <el-date-picker 
                      :editable = 'false'
                      size='small' 
                      style='width:46%;float:right'
                      v-model.trim="form.endStartDtChn"
                      @change='(value) => form.endStartDtChn = value'
                      ormat='yyyy-MM-dd'>
                    </el-date-picker>
                  </el-col>
                </div>
              </el-form-item>
              
              
              

						</el-col>

						<el-col :span='12'>

              <el-form-item label='年龄'>
								<el-col :span='18'>
									 <el-input-number :controls='false' style='width:47%;float:left' size='small' v-model="form.beginAge" :min="0"></el-input-number>
                      <span style='float:left'>
                        &nbsp;-&nbsp;
                      </span>
                   <el-input-number :controls='false' style='width:47.5%;float:left' size='small' v-model="form.endAge" :min="0"></el-input-number>
								</el-col>
							</el-form-item>
              

               <el-form-item label='政治面貌'>
								<el-col :span='18'>
                  <el-select clearable size='small' v-model.trim="form.political" style="width:100%">
										<el-option v-for='(k,i) in politicalList' :value='k.political'></el-option>
									</el-select>
								</el-col>
							</el-form-item>

               <el-form-item label='执业/职业资格证'>
								<el-col :span='18'>
									<el-input size='small' v-model.trim='form.zyzgz'></el-input>
								</el-col>
							</el-form-item>

             

              <el-form-item label='性别'>
                <el-checkbox-group v-model='form.sex'>
                  <el-checkbox v-for='(k,i) in sexList' :key='i' :label='k.value'>{{k.name}}</el-checkbox> 
                </el-checkbox-group>
							</el-form-item>

              

            
						</el-col>

					</el-collapse-item>
          

          <el-collapse-item title="工作信息" name="3">

						<el-col :span='12'>
							<el-form-item label='职级'>
								<el-col :span='18'>
									<el-select clearable size='small' v-model.trim="form.zj" style="width:100%">
										<el-option v-for='(k,i) in zjList' :value='k.zj' :label='k.descr'></el-option>
									</el-select>
								</el-col>
							</el-form-item>

							<el-form-item label='岗位族群'>
								<el-col :span='18'>

                  <el-select clearable size='small' v-model.trim="form.gwzq" style="width:100%">
										<el-option v-for='(k,i) in gwzqList' :label='k.descr' :value='k.gwzq'></el-option>
									</el-select>
								</el-col>
							</el-form-item>

							<el-form-item label='加入集团时间'>
								<el-col :span='18'>
									<el-date-picker 
                    size='small' 
                    style='width:46%;float:left'
                    v-model.trim="form.beginOrgDt"
                      @change='(value) => form.beginOrgDt = value'
                    :editable = 'false'
                      format='yyyy-MM-dd'>
                    </el-date-picker>
                    &nbsp;&nbsp;-
                   <el-date-picker 
                    :editable = 'false'
                    size='small' 
                    style='width:46%;float:right'
                    v-model.trim="form.endOrgDt"
                      @change='(value) => form.endOrgDt = value'
                      format='yyyy-MM-dd'>
                   </el-date-picker>
								</el-col>
							</el-form-item>

              <el-form-item style="margin-left:-5px" label-width="155px" label='加入当前二级公司时间'>
								<el-col :span='18'>
									<el-date-picker 
                    size='small' 
                    style='width:46%;float:left'
                    v-model.trim="form.beginTwoOrgDt"
                      @change='(value) => form.beginTwoOrgDt = value'
                    :editable = 'false'
                      format='yyyy-MM-dd'>
                    </el-date-picker>
                    &nbsp;&nbsp;-
                   <el-date-picker 
                    :editable = 'false'
                    size='small' 
                    style='width:46%;float:right'
                    v-model.trim="form.endTwoOrgDt"
                      @change='(value) => form.endTwoOrgDt = value'
                      format='yyyy-MM-dd'>
                   </el-date-picker>
								</el-col>
							</el-form-item>
						</el-col>

						<el-col :span='12'>
							<el-form-item label='基准岗位'>
								<el-col :span='18'>
									<el-select clearable size='small' v-model.trim="form.jzgw" style="width:100%">
										<el-option v-for='(k,i) in jzgwList' :label='k.descr' :value='k.jzgw'></el-option>
									</el-select>
								</el-col>
							</el-form-item>

							<el-form-item label='子族群'>
								<el-col :span='18'>
                  <el-select clearable size='small' v-model.trim="form.zzq" style="width:100%">
										<el-option v-for='(k,i) in zzqList' :label='k.descr' :value='k.zzq'></el-option>
									</el-select>
								</el-col>
							</el-form-item>

							<el-form-item label='加入本公司时间'>
								<el-col :span='18'>
									<el-date-picker 
                    size='small' 
                    style='width:46%;float:left'
                    v-model.trim="form.beginServiceDt"
                      @change='(value) => form.beginServiceDt = value'
                    :editable = 'false'
                      format='yyyy-MM-dd'>
                    </el-date-picker>
                    &nbsp;&nbsp;-
                   <el-date-picker 
                    :editable = 'false'
                    size='small' 
                    style='width:46%;float:right'
                    v-model.trim="form.endSerciveDt"
                      @change='(value) => form.endSerciveDt = value'
                      format='yyyy-MM-dd'>
                   </el-date-picker>
								</el-col>
							</el-form-item>
              
						</el-col>

					</el-collapse-item>


          <el-collapse-item title="最高学历" name="4">

						<el-col :span='12'>
							<el-form-item label='最高学历'>
								<el-col :span='18'>
									<el-select clearable size='small' v-model.trim="form.highestEdu" style="width:100%">
										<el-option v-for='(k,i) in highestEduList' :value='k.highestEdu'></el-option>
									</el-select>
								</el-col>
							</el-form-item>

							<el-form-item label='专业'>
								<el-col :span='18'>
									<el-input size='small' v-model.trim='form.majorDescr'></el-input>
								</el-col>
							</el-form-item>


						</el-col>

						<el-col :span='12'>
              <el-form-item label='毕业院校'>
								<el-col :span='18'>
									<el-input size='small' v-model.trim='form.schoolDescr'></el-input>
								</el-col>
							</el-form-item>

               <el-form-item label='毕业时间'>
								<el-col :span='18'>
									<el-date-picker 
                     size='small' 
                     style='width:46%;float:left'
                     v-model.trim="form.beginEndDt"
                      @change='(value) => form.beginEndDt = value'
                     :editable = 'false'
                      format='yyyy-MM-dd'>
                    </el-date-picker>
                    &nbsp;&nbsp;-
                   <el-date-picker 
                    :editable = 'false'
                    size='small' 
                    style='width:46%;float:right'
                    v-model.trim="form.endEndDt"
                      @change='(value) => form.endEndDt = value'
                      format='yyyy-MM-dd'>
                   </el-date-picker>
								</el-col>
							</el-form-item>

            
						</el-col>

					</el-collapse-item>

					<!-- <el-collapse-item title="第一学历" name="5">

						<el-col :span='12'>
							<el-form-item label='第一学历'>
								<el-col :span='18'>
									<el-select clearable size='small' v-model.trim="form.firstEdu" style="width:100%">
										<el-option v-for='(k,i) in firstEduList' :label='k.descr' :value='k.firstEdu'></el-option>
									</el-select>
								</el-col>
							</el-form-item>

							<el-form-item label='专业'>
								<el-col :span='18'>
									<el-input size='small' v-model.trim='form.fristMajorDescr'></el-input>
								</el-col>
							</el-form-item>


						</el-col>

						<el-col :span='12'>
              <el-form-item label='毕业院校'>
								<el-col :span='18'>
									<el-input size='small' v-model.trim='form.fristSchoolDescr'></el-input>
								</el-col>
							</el-form-item>

               <el-form-item label='毕业时间'>
								<el-col :span='18'>
									<el-date-picker 
                    size='small' 
                    style='width:46%;float:left'
                    v-model.trim="form.firstBeginEndDt"
                      @change='(value) => form.firstBeginEndDt = value'
                    :editable = 'false'
                      format='yyyy-MM-dd'>
                    </el-date-picker>
                    &nbsp;&nbsp;-
                   <el-date-picker 
                    :editable = 'false'
                    size='small' 
                    style='width:46%;float:right'
                    v-model.trim="form.firstEndEndDt"
                      @change='(value) => form.firstEndEndDt = value'
                      format='yyyy-MM-dd'>
                   </el-date-picker>
								</el-col>
							</el-form-item>

            
						</el-col>

					</el-collapse-item> -->

          
				</el-collapse>

				

			</el-form>

			<div class='saveSearch'>

				<el-button @click.stop='handleSearch("staffInfoTable")' type='primary'>搜索</el-button>

				<span @click.stop='saveSearch'>保存当前搜索条件</span>

			</div>

      

      <SearchDialog 
        @getDialogData ='getDialogData'
        @getLevelNum ='getLevelNum'
        :paramOrg='paramOrg'
        :dialogType='dialogType'
        :dialogShowIf.sync='searchDialogVisible'/>

		</section>

	
</template>

<script>
import Vue from 'vue'
import CollapseTransition from 'element-ui/lib/transitions/collapse-transition'
import Bus from './bus';
import SearchDialog from './searchDialog'
import HistroySearch from './histroySearch'

import {
  MessageBox,
  Message,
  Checkbox,
  CheckboxGroup,
  Pagination,
  InputNumber,
  Col,
  DatePicker,
  Collapse,
  CollapseItem
} from 'element-ui'
Vue.use(Checkbox)
Vue.use(CheckboxGroup)
Vue.use(Pagination)
Vue.use(InputNumber)
Vue.use(Col)
Vue.use(DatePicker)
Vue.use(Collapse)
Vue.use(CollapseItem)
Vue.component(CollapseTransition.name, CollapseTransition)

export default {

  components: {
    SearchDialog,
    HistroySearch
  },
  props: {
    type: {
      type: String,
      default: ''
    },
  },
  data () {
    return {
      activeNames: ['0'],
      form: {
        beginSearchDt:'',  //年月开始
        searchDt: '',    //搜索年月
        controlPower: [],  //管控权
        unionPower: '',  //是否并表权
        oneOrg: '',  //一级组织
        oneLevelNum: '',//一级组织对于的部门层级编号
        twoOrg: '',  //二级组织
        twoLevelNum: '',//二级组织对于的部门层级编号
        threeOrg: '',  //三级组织
        threeLevelNum: '',//三级组织对于的部门层级编号
        fourOrg: '',  //四级组织
        fourLevelNum: '',//四级组织对于的部门层级编号
        deptid: '', //部门的levelNum
        descr: '',  //部门的名字（展示）
        zj: '', //职级
        gwzq: '', //岗位族群
        zzq: '', //子族群
        jzgw: '', //基准岗位
        beginOrgDt: '', // 加入集团时间 （开始）
        endOrgDt: '', // 加入集团时间 （结束）
        beginServiceDt: '', //'开始入司时间',
        endSerciveDt: '',// ·结束入司时间
        ethnic: '', //民族
        beginStartDtChn: '',       //参加工作时间
        endStartDtChn: '',       //参加工作时间
        political: '',  //政治面貌
        marStatus: [],  //婚姻状况
        sex: [],  //性别
        zyjszc: '',  //  专业技术职称
        zyzgz: '', //  执业/职业资格证
        highestEdu: '', //最高学历
        schoolDescr: '', //毕业院校
        majorDescr: '', //专业
        beginEndDt: '', // 开始毕业时间
        endEndDt: '', //结束毕业时间
        // firstEdu: '',  //第一学历
        // fristSchoolDescr: '',      //毕业院校
        // fristMajorDescr: '',       // 专业
        // firstBeginEndDt: '',   //毕业时间
        // firstEndEndDt: '',
        whetherSubDepartment: '', //是否包含自部门
        searchName: '',  //员工姓名
        beginAge: '', //开始年龄
        endAge: '', //结束年龄
        beginTwoOrgDt: '',  //加入二级公司开始
        endTwoOrgDt: '',     //加入二级公司结束
        type: this.type,     //当前报表类型
      },
      oneOrgList: [],
      twoOrgList: [],
      controlPowerList: [
        {
          value:'A',
          label:'掌握经营权'
        },{
          value:'B',
          label:'具有重大影响'
        },{
          value:'C',
          label:'无重大影响'
        }
      ],
      ethnicList: [],
      gwzqList: [],
      highestEduList: [],
      jzgwList: [],
      politicalList: [],
      zjList: [],
      zzqList: [],
      sexList: [
        {
          value: 'M',
          name: '男'
        },
        {
          value: 'F',
          name: '女'
        }, {
          value: 'U',
          name: '未知'
        }
      ],
      marStatusList: [
        {
          mar_desc: '离异',
          mar_status: 'D'
        },
        {
          mar_desc: '已婚',
          mar_status: 'M'
        },
        {
          mar_desc: '未婚',
          mar_status: 'S'
        },
        {
          mar_desc: '未知',
          mar_status: 'U'
        },
        {
          mar_desc: '丧偶',
          mar_status: 'W'
        }
      ],
      // firstEduList: [],
      orgFlag: {
        oneOrg: false,
        twoOrg: false,
        threeOrg: false,
        fourOrg: false,
      },
      close: {
        descr: false,
        threeOrg: false,
        fourOrg: false
      },
      searchDialogVisible: false,
      dialogType: '',
      paramOrg: {
        type: this.type
      },
      page: {
        pageNum: 1,
        pageSize: 40,
        total: 0
      },
      historyRefresh: 1
    }
  },


  mounted () {
    this.getSelectList()
  },

  methods: {

    handleClear (org) {
      const emptyTarget = ['oneOrg', 'twoOrg', 'threeOrg', 'fourOrg'],
        startNum = emptyTarget.indexOf(org)

      if (startNum !== -1) {

        for (let i = startNum + 1; i < emptyTarget.length; i++) {

          this.form[emptyTarget[i]] = ''
        }
      }

      this.form.deptid = ''
      this.form.descr = ''
    },
    closeIconClick (type) {
      // 第三职级改变时 清空部门和第四职级,第四职级改变时 清空部门

      this.form[type] = ''
      type === 'threeOrg' && (this.form.fourOrg = '')
      this.form.deptid = ''
      this.form.descr = ''
      this.close[type] = false
    },

    // 获取三四级组织的levelNum
    getLevelNum (data) {
      const { dialogType, level_num } = data,
        key = dialogType == 'threeOrg' ? 'threeLevelNum' : 'fourLevelNum'

      this.form[key] = level_num

    },
    selectVisibleChange (val, org) {
      if (val) {
        this.orgFlag[org] = val
      } else if (val === false) {
        setTimeout(() => {
          this.orgFlag[org] = val
        }, 100);
      }
    },
    getDialogData (data) {
      const { dialogType, value, deptid } = data
      this.form[dialogType] = value

      // 如果是部门 要多传一个值（levelNum）
      if (dialogType === 'descr') {
        this.form.deptid = deptid
      }

      if (dialogType === 'threeOrg' || dialogType === 'fourOrg') {
        this.form.deptid = ''
        this.form.descr = ''
        dialogType === 'threeOrg' && (this.form.fourOrg = '')
      }
    },

    handleOneTwoChange (val, org) {
      /*
        当一二级组织选择状态改变时 清空当前级以后的级和部门的值
        @val: 当前组织选中的值
        @org: 当前是哪个组织
        @startNum: 从哪开始清空
      */
      this.$nextTick(() => {

        if (val) {

          const selectArr = this[`${org}List`].filter(ele => ele.descr === val)

          selectArr.length && (this.paramOrg = selectArr[0])

        } else {

          this.paramOrg = {}
          this.paramOrg.type = this.type
        }


        //如果是用户手动选择而不是赋值,清空当前组织后面的所有组织
        if (this.orgFlag[org]) {
          const emptyTarget = ['oneOrg', 'twoOrg', 'threeOrg', 'fourOrg'],
            startNum = emptyTarget.indexOf(org)

          if (startNum !== -1) {

            for (let i = startNum + 1; i < emptyTarget.length; i++) {

              this.form[emptyTarget[i]] = ''
            }
          }

          this.form.deptid = ''
          this.form.descr = ''
        }
      })
    },

    showCloseIcon (type) {
      this.form[type] && (this.close[type] = true)
    },

    getSelectList () {

      // 获取一二级下拉菜单
      const _getOneTwoSelected = () => {
        for (let i = 1; i <= 2; i++) {
          let params = {
            id: i, //当前组织级数 从1计算
            level_num: '',  //上级组织的level_num   
            type: this.type
          }

          this.Axios
            .Post('/reportSearch/getOrgList', params)
            .then((res) => {
              const data = res.data.datas
              i == 1 ? this.oneOrgList = data : this.twoOrgList = data
            })
        }
      }


      const _allSelected = () => {
        let params = {
          type: this.type
        }

        this.Axios
          .Post('/reportSearch/getSkDropDownList', params)
          .then((res) => {
            const data = res.data.datas
            for (const key in data) {
              this[key] = data[key]
            }
          })
      }

      // const _firstEducation = () => {
      //   let params = {
      //     type: this.paramType
      //   }

      //   this.Axios
      //     .Post('/reportSearch/getSkEmpDropDownList', params)
      //     .then((res) => {
      //       const data = res.data.datas
      //       this.firstEduList = data
      //     })
      // }

      _getOneTwoSelected()
      // _firstEducation()
      _allSelected()

    },

    handleSearchDialog (dialogType) {
      this.dialogType = dialogType
      this.searchDialogVisible = true
    },


    getTransformParams () {

      let params = { ...this.form }

      params.oneLevelNum = params.oneOrg.level_num || ''
      params.twoLevelNum = params.twoOrg.level_num || ''

      // params.oneOrg = params.oneOrg.descr || ''
      // params.twoOrg = params.twoOrg.descr || ''

      params.unionPower = params.unionPower - 0
      params.whetherSubDepartment = params.whetherSubDepartment - 0
      params.marStatus = params.marStatus.join(',')
      params.sex = params.sex.join(',')
      params.pageNum = this.page.pageNum
      params.pageSize = this.page.pageSize
      params.controlPower = params.controlPower.join(',')

      return params

    },


    // 保存搜索条件
    saveSearch () {

      MessageBox.prompt('请为该搜索条件命名', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        inputPattern: /\S/,
        inputErrorMessage: '内容不能为空'
      })
        .then(({ value }) => {

          const params = { ...this.getTransformParams(), conditoinName: value }
          this.Axios
            .Post('/reportSearch/saveReportSearch', params)
            .then((res) => {

              if (res.data.status === 1) {
                //刷新最新搜索条件 
                this.historyRefresh++
                Message({
                  type: 'success',
                  message: res.data.message
                })
              }

            })

        })
        .catch(() => { })

    },

    handleSearch (formName) {

      this.$refs[formName].validate((valid) => {
        if (valid) {


          const params = this.getTransformParams()
          Bus.$emit('params', params)
          this.Axios
            .Post('/newComers/queryNewComersList', params)
            .then((res) => {
              Bus.$emit('tableDatas', res.data.datas)
              Bus.$emit('tableVisible', true)
              Bus.$emit('page', res.data.page)
            })

        } else {
          window.scrollTo(0, 0)
          return false;
        }
      });
    }

  }
}
</script>

<style lang="less" scoped>
.form {
  padding: 20px 20px 0 20px;
  .close-x {
    position: absolute;
    top: 12px;
    right: 11%;
    color: #bfcbd9;
    background-color: #fff;
    cursor: pointer;
  }
  .saveSearch {
    margin: 15px 0 25px 0;
    & > span {
      margin-left: 10px;
      cursor: pointer;
      color: #41b883;
    }
  }
}
</style>


<style>
.laborCost .form .el-form-item {
  margin-bottom: 10px;
}
.laborCost .form .el-form-item.is-error.is-required {
  margin-bottom: 25px;
}
</style>
